<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{$lang.home}{if $ur_here} - {$ur_here} {/if}</title>
<meta name="Copyright" content="Douco Design." />
<link href="templates/public.css" rel="stylesheet" type="text/css">
<style type="text/css">
{literal}
.uploadImg{
   width:auto;
   height:auto;
   max-width:50px;
   max-height:50px;
}
{/literal}
</style>
{include file="javascript.htm"}
</head>
<body>
<div id="dcWrap">
 {include file="header.htm"}
 <div id="dcLeft">{include file="menu.htm"}</div>
 <div id="dcMain">
   {include file="ur_here.htm"}
   <div id="user" class="mainBox" style="{$workspace.height}">
    <h3> <a href="{$chatlog_link.href}" class="actionBtn">{$chatlog_link.text}</a> <!--<a href="chatlog.php?rec=config" class="actionBtn">其他设置</a>--> {$ur_here}</h3>

    <!-- {if $rec eq 'default'} 会员列表 -->
    <div class="filter">
      <form action="chatlog.php" method="post">
        <input name="username" class="inpMain" placeholder="用户名" value="" size="20" type="text">
        <input name="content" class="inpMain" placeholder="内容" value="" size="20" type="text">
        <select name="room_id">
          <option value="">选择房间</option>
          {foreach from=$rooms item=v}
          <option value="{$v.roomnumber}">{$v.name}</option>
          {/foreach}
        </select>
        <select name="remark">
          <option value="">敏感消息(全部)</option>
          <option value="0">否</option>
          <option value="1">是</option>
        </select>
        <select name="status">
          <option value="">消息状态(全部)</option>
          <option value="normal">正常</option>
          <option value="hidden">屏蔽</option>
        </select>
        <!--
        <select name="msg_status">
          <option value="">全部</option>
          <option value="remark">敏感消息</option>
          <option value="blacklist">黑名单消息</option>
        </select>
      -->
        <input name="submit" class="btnGray" value="查询" type="submit">
      </form>
    </div>

    <form name="action" method="post" action="chatlog.php?rec=action">
    <div class="action">
     <input name="opt_add_hidden" class="btn" type="submit" value="屏蔽" />
     <input name="opt_add_gag" class="btn" type="submit" value="禁言" />
     <input name="opt_add_blacklist" class="btn" type="submit" value="拉黑" />
     <input name="opt_del_all" class="btn" type="submit" value="删除" />
    </div>
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
     <tr>
      <th width="22" align="center"><input name='chkall' type='checkbox' id='chkall' onclick='selectcheckbox(this.form)' value='check'></th>
      <th width="30" align="left">{$lang.record_id}</th>
      <th align="center">{$lang.room}</th>
      <th align="center">{$lang.user_username}</th>
      <th align="center">{$lang.mobile}</th>
      <th align="center" width="40%">{$lang.content}</th>
      <th align="center" width="10%">{$lang.chat_time}</th>
      <th align="center">消息状态</th>
      <th align="center">禁言操作</th>
      <th align="center">拉黑操作</th>
      <th align="center">消息屏蔽</th>
      <th>{$lang.handler}</th>
     </tr>
     <!-- {foreach from=$chatlog_list item=chatlog} -->
     <tr>
      <td align="center"><input type="checkbox" name="checkbox[]" value="{$chatlog.id}" /></td>
      <td>{$chatlog.id}</td>
      <td align="center">{$rooms[$chatlog.room_id].name}</td>
      <td align="center">{if $chatlog.group_id==0}{$chatlog.username}游客{$chatlog.user_id}{else}<a href='user.php?rec=edit&id={$chatlog.user_id}' target="_blank">{$chatlog.username}</a>{/if}</td>
      <td align="center">{$chatlog.mobile}</td>
      <td align="center">{$chatlog.content}</td>
      <td align="center">{$chatlog.chat_time}</td>

      <td align="center">{$lang.status_in[$chatlog.status]}</td>
      <td align="center">
        {if $chatlog.isgag == '0'}<a href="chatlog.php?rec=action&opt=add_gag&checkbox={$chatlog.id}" style="color:green">立即禁言</a>{/if}
        {if $chatlog.isgag == '1'}<a href="chatlog.php?rec=action&opt=del_gag&checkbox={$chatlog.id}" style="color:blue">解除禁言</a>{/if}
      </td>
      <td align="center">
        {if $chatlog.user_status == 'normal'}<a href="chatlog.php?rec=action&opt=add_blacklist&checkbox={$chatlog.id}" style="color:green">加入黑名单</a>{/if}
        {if $chatlog.user_status == 'hidden'}<a href="chatlog.php?rec=action&opt=del_blacklist&checkbox={$chatlog.id}" style="color:blue">解除黑名单</a>{/if}
      </td>
      <td align="center">
        {if $chatlog.status == 'normal'}<a href="chatlog.php?rec=action&opt=add_hidden&checkbox={$chatlog.id}" style="color:green">屏蔽</a>{/if}
        {if $chatlog.status == 'hidden'}<a href="chatlog.php?rec=action&opt=del_hidden&checkbox={$chatlog.id}" style="color:blue">恢复</a>{/if}
      </td>
      <td align="center" align="center">
        <a href="chatlog.php?rec=edit&id={$chatlog.id}">{$lang.edit}</a> | 
        <a href="chatlog.php?rec=del&id={$chatlog.id}">{$lang.del}</a>  
     </tr>
     <!-- {/foreach} -->
    </table>
    <div class="action">
     <input name="opt_add_hidden" class="btn" type="submit" value="屏蔽" />
     <input name="opt_add_gag" class="btn" type="submit" value="禁言" />
     <input name="opt_add_blacklist" class="btn" type="submit" value="拉黑" />
     <input name="opt_del_all" class="btn" type="submit" value="删除" />
    </div>
    </form>
    {include file="pager.htm"}
    <!-- {/if} -->
    
    <!-- {if $rec eq 'edit' || $rec eq 'add'} 编辑 -->
    <form action="chatlog.php?rec={if $rec eq 'edit'}update{else}insert{/if}" method="post">
     <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
      <tr>
       <td width="100" align="right">{$lang.roomnumber}</td>
       <td>
        <input type="text" name="room_id" value="{$chatlog.room_id}" size="40" class="inpMain" disabled="disabled"/>
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.content}</td>
       <td>{$chatlog.content}</td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.user_nickname}</td>
       <td><input type="text" name="nickname" value="{if !$chatlog.nickname}游客{$chatlog.user_id}{else}{$chatlog.nickname}{/if}" size="40" class="inpMain" disabled="disabled"/></td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.user_mobile}</td>
       <td><input type="text" name="mobile" value="{$chatlog.mobile}" size="40" class="inpMain" disabled="disabled"/></td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.status}</td>
       <td>
         <select name="status">
         {foreach from=$lang.status_in item=v key=k}
         <option value="{$k}" {if $k==$chatlog.status}selected=selected{/if} >{$v}</option>
         {/foreach}
          </select>
       </td>
      </tr>
      <tr>
       <td></td>
       <td>
        <input type="hidden" name="token" value="{$token}" />
        <input type="hidden" name="id" value="{$chatlog.id}" />
        <input type="submit" name="submit" class="btn" value="{$lang.btn_submit}" />
       </td>
      </tr>
     </table>
    </form>
    <!-- {/if} -->

   </div>
 </div>
 {include file="footer.htm"}
 </div>
</body>
</html>